Exemple #1
0
        /*
         * This static Class is the center of the System.
         * It holds all Resources except Thread and File.
         */

        //加
        static CU()
        {
            SET_UDP = new UDPSetting();
            MG_UDP  = new UDPManager(SET_UDP);
            MG_User = new UserManager();
            Player  = new Player();
            MG_Page = new SceneManager();
        }
Exemple #2
0
        private void LoadUDP()
        {
            UDP            = new UDPSetting();
            UDP.Port       = Int32.Parse(App["udp"]["port"]);
            UDP.BufferSize =
                Int32.Parse(App["udp"]["port"]);

            UDPOffset = FileManager.GetOffset();
        }
Exemple #3
0
 private void InitClient(UDPSetting setting)
 {
     if (client != null)
     {
         Close();
     }
     client = new UdpClient(setting.Port);
     client.Client.ReceiveTimeout = setting.TimeOut;
     client.Client.SendTimeout    = setting.TimeOut;
     clientEndPoint = new IPEndPoint(setting.IP, setting.Port);
     if (setting.BufferSize > 0)
     {
         client.Client.ReceiveBufferSize = setting.BufferSize;
     }
 }
Exemple #4
0
 private void InitServer(UDPSetting setting)
 {
     serverEndPoint = new IPEndPoint(setting.ServerIP, setting.ServerPort);
 }
Exemple #5
0
 private void InitUDP(UDPSetting setting)
 {
     InitClient(setting);
     InitServer(setting);
 }
Exemple #6
0
 private IPEndPoint serverEndPoint;  // 接收目标或发送目标一律视为服务端
 public UDP(UDPSetting setting)
 {
     this.setting = setting;
 }
Exemple #7
0
 public UDPManager(UDPSetting setting)
 {
     this.udpSetting = setting;
     this.udp        = new UDP(setting);
     get_offset      = FileManager.GetOffset();
 }