Copying and Pasting cs Code

In cs, like in almost any computer programming language, reading data from a file can be tricky. You add extra lines of code to tell the computer what to do. Sometimes you can copy and paste these lines from other peoples’ code.

For example, you can follow the pattern in this listing:

     /// Called at disconnect/leavelobby etc. This CAN also be called when we are not in a lobby (e.g. disconnect from room)
     private void LeftLobbyCleanup()
     {
         this.mGameList = new Dictionary();
         this.mGameListCopy = new RoomInfo[0];

         if (insideLobby)
         {
             this.insideLobby = false;
             SendMonoMessage(PhotonNetworkingMessage.OnLeftLobby);
         }
     }