Example #1
0
 // ServerEvents
 static void ServerOnConnect(int remoteID, string remoteIP)
 {
     fm1.Chat_Add(string.Format("server:client{0}({1})からの接続を確立しました", remoteID, remoteIP));
     if (svStat == SERVERSTAT.WAITP1)
     {
         sv.player1 = remoteID;
         if (sv.player2 == -1)
         {
             svStat = SERVERSTAT.WAITP2;
         }
         else
         {
             svStat = SERVERSTAT.PLAYING;
         }
     }
     else if (svStat == SERVERSTAT.WAITP2)
     {
         sv.player2 = remoteID;
         if (sv.player1 == -1)
         {
             svStat = SERVERSTAT.WAITP1;
         }
         else
         {
             svStat = SERVERSTAT.PLAYING;
         }
     }
 }
Example #2
0
 public static bool OpenServer(int port)
 {
     try
     {
         sv = new VisionServer(port, ServerOnConnect, ServerOnRecv, ServerOnDisconnect, 12288);
     }
     catch (Exception)
     {
         return false;
     }
     svStat = SERVERSTAT.WAITP1;
     return true;
 }
Example #3
0
 static public bool OpenServer(int port)
 {
     try
     {
         sv = new VisionServer(port, ServerOnConnect, ServerOnRecv, ServerOnDisconnect, 12288);
     }
     catch (Exception)
     {
         return(false);
     }
     svStat = SERVERSTAT.WAITP1;
     return(true);
 }
Example #4
0
 // ServerEvents
 static void ServerOnConnect(int remoteID, string remoteIP)
 {
     fm1.Chat_Add(string.Format("server:client{0}({1})からの接続を確立しました", remoteID, remoteIP));
     if (svStat == SERVERSTAT.WAITP1) {
         sv.player1 = remoteID;
         if (sv.player2 == -1)
         {
             svStat = SERVERSTAT.WAITP2;
         }
         else
         {
             svStat = SERVERSTAT.PLAYING;
         }
     }
     else if (svStat == SERVERSTAT.WAITP2) {
         sv.player2 = remoteID;
         if (sv.player1 == -1)
         {
             svStat = SERVERSTAT.WAITP1;
         }
         else
         {
             svStat = SERVERSTAT.PLAYING;
         }
     }
 }