예제 #1
0
        public GameClient(IClientTransportLayer transportLayer, UserInfo userInfo, bool printDebugOutput)
        {
            this.transportLayer    = transportLayer;
            this.UserId            = userInfo.UserId;
            this.printDebugOutput  = printDebugOutput;
            this.readonlyUsersList = new ReadOnlyCollection <UserInfo>(this.users);

            this.myUserInfo = new UserInfo();
            this.myUserInfo.CopyFrom(userInfo);

            this.messageCollection = new MessageCollection();

            // client to server
            this.messageCollection.RegisterMessage <JoinServerRequestMessage>();
            this.messageCollection.RegisterMessage <UpdateUserInfoMessage>();

            // server to client
            this.messageCollection.RegisterMessage <JoinServerResponseMessage>();
            this.messageCollection.RegisterMessage <UserDisconnectedMessage>();
            this.messageCollection.RegisterMessage <UserInfoMessage>();
        }
예제 #2
0
        public GameClient(IClientTransportLayer transportLayer, UserInfo myUserInfo, string joinServerCustomData)
        {
            this.transportLayer = transportLayer;

            this.UserId = myUserInfo.UserId;

            this.myUserInfo = new UserInfo();
            this.myUserInfo.CopyFrom(myUserInfo);

            this.joinServerCustomData = joinServerCustomData;

            this.messageCollection = new MessageCollection();

            // client to server
            this.messageCollection.RegisterMessage <JoinServerRequestMessage>();
            this.messageCollection.RegisterMessage <UpdateUserInfoMessage>();

            // server to client
            this.messageCollection.RegisterMessage <JoinServerResponseMessage>();
            this.messageCollection.RegisterMessage <UserDisconnectedMessage>();
            this.messageCollection.RegisterMessage <UserInfoMessage>();

            this.RegisterCustomMessages(this.messageCollection);
        }
예제 #3
0
 public PlayFabGameClient(IClientTransportLayer transportLayer, UserInfo myUserInfo, string playfabId, string matchmakingTicket)
     : base(transportLayer, SetUserId(myUserInfo, playfabId), matchmakingTicket)
 {
 }