Exemple #1
0
        public override void Register(PhotonServerPeer peer)
        {
            var registerSubServerOperation =
                new RegisterSubServerData()
            {
                GameServerAddress = PublicIpAddress.ToString(),
                TcpPort           = TcpPort,
                UdpPort           = UdpPort,
                ServerId          = ServerId,
                ServerType        = ServerType,
                ApplicationName   = ApplicationName
            };

            peer.SendOperationRequest(new OperationRequest((byte)ServerOperationCode.RegisterSubServer,
                                                           new RegisterSubServer()
            {
                RegisterSubServerOperation = SerializeUtil.Serialize(registerSubServerOperation)
            }), new SendParameters());
        }
Exemple #2
0
        public override void Register(PhotonServerPeer peer)
        {
            var registerSubServerOperation = new RegisterSubServerData()
            {
                GameServerAddress = PublicIpAddress.ToString(),
                TcpPort           = TcpPort,
                UdpPort           = UdpPort,
                ServerId          = ServerId,
                ServerType        = ServerType,
                ApplicationName   = ApplicationName
            };
            XmlSerializer mySerializer = new XmlSerializer(typeof(RegisterSubServerData));
            StringWriter  outString    = new StringWriter();

            mySerializer.Serialize(outString, registerSubServerOperation);

            peer.SendOperationRequest(
                new OperationRequest((byte)ServerOperationCode.RegisterSubServer,
                                     new RegisterSubServer()
            {
                RegisterSubServerOperation = outString.ToString()
            }), new SendParameters());
        }