Esempio n. 1
0
 private void SendAddUserAction(AddUserAction action, NetworkStream stream)
 {
     WriteInt(action.User.Id, stream);
     WriteString(action.User.Name, stream);
 }
Esempio n. 2
0
        private AddUserAction GetAddUserAction(/*int senderId, */NetworkStream stream)
        {
            // Get user ID
            int id = ReadInt(stream);

            // Get user name
            string name = ReadString(stream);

            var action = new AddUserAction(_manager.ClientList, _manager.SendList);
            action.User = new UserInfo(null, id, _manager.ShapeDrawer);
            action.User.Name = name;

            return action;
        }