Пример #1
0
        private void OnLobbyCreated(RailID lobbyID)
        {
            WeGameHelper.WriteDebugString("SetLocalPeer: {0}", (object)(ulong)((RailComparableID)lobbyID).id_);
            this._reader.SetLocalPeer(lobbyID);
            this._writer.SetLocalPeer(lobbyID);
            this._serverID = lobbyID;
            Action action = (Action)(() =>
            {
                // ISSUE: explicit non-virtual call
                ReportServerID t = new ReportServerID()
                {
                    _serverID = (((RailComparableID)lobbyID).id_.ToString())
                };
                IPCMessage msg = new IPCMessage();
                msg.Build <ReportServerID>(IPCMessageType.IPCMessageTypeReportServerID, t);
                WeGameHelper.WriteDebugString("Send serverID to game client - " + this._client.SendMessage(msg).ToString());
            });

            if (this._serverConnected)
            {
                action();
            }
            else
            {
                this._ipcConnetedAction += action;
                WeGameHelper.WriteDebugString("report server id fail, no connection");
            }
        }
        private void OnLobbyCreated(RailID lobbyID)
        {
            WeGameHelper.WriteDebugString("SetLocalPeer: {0}", ((RailComparableID)lobbyID).id_);
            _reader.SetLocalPeer(lobbyID);
            _writer.SetLocalPeer(lobbyID);
            _serverID = lobbyID;
            Action action = delegate
            {
                ReportServerID t = new ReportServerID
                {
                    _serverID = ((RailComparableID)lobbyID).id_.ToString()
                };
                IPCMessage iPCMessage = new IPCMessage();
                iPCMessage.Build(IPCMessageType.IPCMessageTypeReportServerID, t);
                WeGameHelper.WriteDebugString("Send serverID to game client - " + _client.SendMessage(iPCMessage));
            };

            if (_serverConnected)
            {
                action();
                return;
            }
            _ipcConnetedAction = (Action)Delegate.Combine(_ipcConnetedAction, action);
            WeGameHelper.WriteDebugString("report server id fail, no connection");
        }
Пример #3
0
 private void OnWegameMessage(IPCMessage message)
 {
     if (message.GetCmd() == IPCMessageType.IPCMessageTypeReportServerID)
     {
         message.Parse(out ReportServerID value);
         OnReportServerID(value);
     }
 }
Пример #4
0
        private void OnDataArrive(byte[] data)
        {
            IPCMessage iPCMessage = new IPCMessage();

            iPCMessage.BuildFrom(data);
            if (this.OnMessage != null)
            {
                this.OnMessage(iPCMessage);
            }
        }
        private void OnWegameMessage(IPCMessage message)
        {
            IPCMessageType cmd = message.GetCmd();

            if (cmd == IPCMessageType.IPCMessageTypeNotifyFriendList)
            {
                message.Parse <WeGameFriendListInfo>(out var value);
                UpdateFriendList(value);
            }
        }
Пример #6
0
        private void OnWegameMessage(IPCMessage message)
        {
            if (message.GetCmd() != IPCMessageType.IPCMessageTypeNotifyFriendList)
            {
                return;
            }
            WeGameFriendListInfo friendListInfo;

            message.Parse <WeGameFriendListInfo>(out friendListInfo);
            this.UpdateFriendList(friendListInfo);
        }
Пример #7
0
        private void OnDataArrive(byte[] data)
        {
            IPCMessage ipcMessage = new IPCMessage();

            ipcMessage.BuildFrom(data);
            if (this.OnMessage == null)
            {
                return;
            }
            this.OnMessage(ipcMessage);
        }
Пример #8
0
        private void OnWegameMessage(IPCMessage message)
        {
            if (message.GetCmd() != IPCMessageType.IPCMessageTypeReportServerID)
            {
                return;
            }
            ReportServerID reportServerID;

            message.Parse <ReportServerID>(out reportServerID);
            this.OnReportServerID(reportServerID);
        }
Пример #9
0
        private bool SendFriendListToLocalServer()
        {
            bool result = false;

            if (_hasLocalHost)
            {
                List <RailFriendInfo> list = new List <RailFriendInfo>();
                if (GetRailFriendList(list))
                {
                    WeGameFriendListInfo t = new WeGameFriendListInfo
                    {
                        _friendList = list
                    };
                    IPCMessage iPCMessage = new IPCMessage();
                    iPCMessage.Build(IPCMessageType.IPCMessageTypeNotifyFriendList, t);
                    result = _msgServer.SendMessage(iPCMessage);
                    WeGameHelper.WriteDebugString("NotifyFriendListToServer: " + result.ToString());
                }
            }
            return(result);
        }
Пример #10
0
        private bool SendFriendListToLocalServer()
        {
            bool flag = false;

            if (this._hasLocalHost)
            {
                List <RailFriendInfo> list = new List <RailFriendInfo>();
                if (this.GetRailFriendList(list))
                {
                    WeGameFriendListInfo t = new WeGameFriendListInfo()
                    {
                        _friendList = list
                    };
                    IPCMessage msg = new IPCMessage();
                    msg.Build <WeGameFriendListInfo>(IPCMessageType.IPCMessageTypeNotifyFriendList, t);
                    flag = this._msgServer.SendMessage(msg);
                    WeGameHelper.WriteDebugString("NotifyFriendListToServer: " + flag.ToString());
                }
            }
            return(flag);
        }
Пример #11
0
 public bool SendMessage(IPCMessage msg)
 {
     return(_ipcSever.Send(msg.GetBytes()));
 }
Пример #12
0
 public bool SendMessage(IPCMessage msg)
 {
     return(this._ipcClient.Send(msg.GetBytes()));
 }