| Mirage Source http://web.miragesource.net/forums/ |
|
| About Konfuze PM Sys http://web.miragesource.net/forums/viewtopic.php?f=210&t=498 |
Page 1 of 1 |
| Author: | Shadow Dragon [ Mon Sep 11, 2006 4:32 pm ] |
| Post subject: | About Konfuze PM Sys |
Hey Guys I made a instant messenger based off of the one from Konfuze and I was wondering if you could help me with some code, I'm trying to make it so that when the invite is sent a small picture box is displayed with the accept and decline buttons on it. could someone help me out? |
|
| Author: | Leighland [ Mon Sep 11, 2006 10:57 pm ] |
| Post subject: | |
Use the same system as mirage does for sending packets. Client side have the user type something like /pminvite <name> send a packet to server read packet from server send request to "name" print data on a picture box on "name's" client window make two buttons so "name" can accept or decline send "name's" input to the server send "name's" input from server to person who sent invite if "name" accepts, bring up the PM window |
|
| Author: | Shadow Dragon [ Tue Sep 12, 2006 12:49 am ] |
| Post subject: | |
Well, I had it to where it makes the thing appear, the thing is that it made awhole new form appear. but I have the pm in a seperate form of it's own called frmPT and I can't figure out how to make it so when you click the send invite button, it calls to make the picture box on frmMirage visible, and then when you click accept or decline on that picture box it sends the return message back to the other player in a msgbox that says yes or no. Any idea how to do that? |
|
| Author: | DarkX [ Tue Sep 12, 2006 1:01 am ] |
| Post subject: | |
Well you could do like I did, (yesturday) and make it so that the "buttons" are actually size 7 or size 6 labels that say invite accept and decline, and then change call playermsg and make it so that it says something like "You have been invited to chat with(Playername). click one of the labels above the text field to engage in a private conversation with (playername)." <-The words within the qoutes will appear inside the text box but it might be possible to make them be bigger than the others, or just define a seperate color just for things of that type. |
|
| Author: | Leighland [ Tue Sep 12, 2006 3:25 am ] |
| Post subject: | |
When the user accepts or declines you need to send a message back to the server, and then send the person who requested the private chat that message from the server. Client: Code: Sub SendAnswer(ByVal MsgFrom as Long) Dim packet as string packet = "DECLINEINVITE" & SEP_CHAR & MsgFrom & SEP_CHAR & END_CHAR SendData(packet) End Sub Server: Code: If LCase(Parse(0)) = "declineinvite" Then Dim InviteFrom = Parse(1) Call PlayerMsg(InviteFrom, "That person has declined your request to chat privately.", Red) Exit Sub End If If you want it in a message box then you need to set up a new command to display message on a messagebox.. and instead of sending the message using the "PlayerMsg" routine, use the following: Server: Code: If LCase(Parse(0)) = "declineinvite" Then Dim InviteFrom = Parse(1) Dim packet as String Msg = "That person has declined your request to chat privately." packet = "DECLINED" & SEP_CHAR & Msg & SPE_CHAR & END_CHAR Call SendDataTo(InviteFrom, packet) Exit Sub End If Client Side: Code: If LCase(Parse(0)) = "declined" Then Call AlertBox(Parse(1)) Exit Sub End If Code: Sub AlertBox(ByVal Message As String)
If LEN(Message) > 0 then Call MsgBox(Message, vbOkOnly) End If End Sub That make more sense? |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|