Ejemplo n.º 1
0
 public static String Read(ComboServer.Socketserver.SocketPacket PSPsocketData, String PstrData, Protocol Pprotocol)
 {
     PstrData = PstrData.Replace("\0", "");
     while (PstrData.Contains("<INFO>") && PstrData.Contains("</INFO>"))
     {
         int intIndex = PstrData.IndexOf("</INFO>") + 7;
         string strBuffer2 = PstrData.Substring(0, intIndex);
         Pprotocol.handleInfo(strBuffer2, PSPsocketData.socketworkerid);
         PstrData = PstrData.Substring(intIndex);
     }
     if (PstrData.Contains("<PING>") && PstrData.Contains("</PING>"))
     {
         int intIndex = PstrData.IndexOf("</PING>");
         string strNaam = PstrData.Substring(6, intIndex-6);
         PSPsocketData.strNaam = strNaam;
         PstrData = PstrData.Substring(intIndex+8);
         string strData = "ACTION=PING;PLAYER=" + strNaam + ";<END>";
         byte[] byData = System.Text.Encoding.ASCII.GetBytes(strData);
         PSPsocketData.socketCurrent.Send(byData);
     }
     return PstrData;
 }
Ejemplo n.º 2
0
 public Socketserver(int PintPoort, Form_Main formMain)
 {
     this.intPort = PintPoort;
     this.formMain = formMain;
     this.intMaxClients = 200;
     ALintsClientId = new ArrayList();
     blist = new BListController(this, formMain.World);
     protocol = new Protocol(blist);
 }
Ejemplo n.º 3
0
 public SocketPacket(int PintDatalength, Socketserver Pserver, Protocol protocol, int socketworkerid)
 {
     this.protocol = protocol;
     this.intDataLength = PintDatalength;
     this.intClientID = -1;
     this.server = Pserver;
     this.socketworkerid = socketworkerid;
     BAdatabuffer = new byte[intDataLength];
     CABuffer = new Char[intDataLength];
     strBuffer = "";
 }