text: (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{172:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("After creating responses to the LoginRequest on the server we can let the client handle them.\nTo do that we first have to subscribe to server messages in the LoginManager script.\nAdd the following in the Start() function:")]),t._v(" "),t._m(1),a("p",[t._v("and the function:")]),t._v(" "),t._m(2),a("p",[t._v("(We always have to unsubscribe from events)")]),t._v(" "),a("p",[t._v("Also add the OnMessage function and functions to handle the responses:")]),t._v(" "),t._m(3),a("p",[t._v("The OnMessage function works like the one we did on the server.")]),t._v(" "),a("p",[t._v("OnLoginDecline will just show the login window again. (You could a line of text saying login failed or something like that)")]),t._v(" "),a("p",[t._v("OnLoginAccept will store the data and load a LobbyScene to do that we first have to create fields in the GlobalManager to store data. (We will store all data that has to be preserved on scene changes in the GlobalManager).")]),t._v(" "),a("p",[t._v("So Add to the GlobalManager:")]),t._v(" "),t._m(4),a("p",[t._v("and then change to OnLoginAccept() function in the LoginManager to:")]),t._v(" "),t._m(5),a("p",[t._v("Now let's create the client side lobby.")]),t._v(" "),t._m(6),t._v(" "),a("p",[t._v("We want to display a list of all rooms in graphical matter, we will use UI elements for that:")]),t._v(" "),t._m(7),t._v(" "),a("p",[t._v("Now we need to create RoomObjects. First create a RoomObject script in the Scripts folder and open it and fill it with the following code:")]),t._v(" "),t._m(8),a("p",[t._v("Should be self explaining the Set function is used to apply a RoomData to it.\nWe will also have to create a prefab for the script:")]),t._v(" "),t._m(9),t._v(" "),a("p",[t._v("It should look now kind of like "),a("a",{attrs:{href:"https://imgur.com/gallery/6ElYM5g",target:"_blank",rel:"noopener noreferrer"}},[t._v("this"),a("OutboundLink")],1),t._v(":"),a("br"),t._v(" "),a("img",{attrs:{src:"https://i.imgur.com/2xuzOVj.png",alt:""}})]),t._v(" "),a("p",[t._v("Now drag the RoomListPrefab into the prefabs folder and then delete it from the scene.")]),t._v(" "),a("p",[t._v("Open the LobbyManager script and set it to:")]),t._v(" "),t._m(10),a("p",[t._v("This might look overwhelming at the first glance but its very simple.\nThe script has a reference to a RoomListContainerTransform which is the transform of the Content and a reference to the RoomListPrefab. (you should go drag them into their respective fields).\nIt also subscribes like the LoginManager to the server to recieve messages.")]),t._v(" "),a("p",[t._v("The last thing it does is the RefreshRooms() function. I'm not going to explain that function but it does refresh the display of all the rooms, it shouldn't be too complicated to understand.")]),t._v(" "),a("p",[t._v('At this point you can try to run the project. Run the server first and then the client and check it you can log in and if it displays 2 rooms "Main" and "Main 2" in the lobby.')]),t._v(" "),a("p",[t._v("If everyting works fine you can continue, if not try to look if any errors occurred somewhere. If you are totally stuck you can always contact me on Discord (@Allmaron#6641) or ask in the "),a("a",{attrs:{href:"https://discordapp.com/invite/cz2FQ6k",target:"_blank",rel:"noopener noreferrer"}},[t._v("Offical Darkrift Discord"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("The next step is to allow the player to join a Room. We will need to create new request messages for that.\nFirst add the following new Tags in the NetworkingData.Tags enum:")]),t._v(" "),t._m(11),a("p",[t._v("We also need a new data object for the request so also add:")]),t._v(" "),t._m(12),a("p",[t._v("And then open the LobbyManager and add these functions:")]),t._v(" "),t._m(13),a("p",[t._v("And change the OnMessage function to:")]),t._v(" "),t._m(14),a("p",[t._v('Ok so what does this do?\nWe have a function SendJoinRoomRequest to ask the server to join a room with a given Name.\nThe server can respond with a Accepted or a Denied answer. The denied request will contain new RoomDatas so that the rooms and available slots get refreshed and the accepted will just load the "Game" scene because it means we connected successfully.')]),t._v(" "),a("p",[t._v("Now we just need a way to call SendJoinRoomReques(). We will subscribe the function to the buttons in the list of rooms.\nTo do that open the RoomListObject script and at the end of the Set function the following lines:")]),t._v(" "),t._m(15),a("p",[t._v("Your scripts should look like this:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://pastebin.com/ue7T0sFL",target:"_blank",rel:"noopener noreferrer"}},[t._v("LoginManager"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://pastebin.com/wMBubKxN",target:"_blank",rel:"noopener noreferrer"}},[t._v("GlobalManager"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://pastebin.com/2Fvczdq1",target:"_blank",rel:"noopener noreferrer"}},[t._v("RoomListObject"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://pastebin.com/MZpWAuqX",target:"_blank",rel:"noopener noreferrer"}},[t._v("LobbyManager"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://pastebin.com/HYXKwysi",target:"_blank",rel:"noopener noreferrer"}},[t._v("Networking Data"),a("OutboundLink")],1)])]),t._v(" "),a("p",[t._v("The lobby and login system is now fully completed on the client, we will swap now to the server to finish the system there too.")])])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"client-login-system-part-2-and-lobby"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#client-login-system-part-2-and-lobby","aria-hidden":"true"}},[this._v("#")]),this._v(" Client Login System part 2 and Lobby")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-csharp extra-class"},[a("pre",{pre:!0,attrs:{class:"language-csharp"}},[a("code",[t._v("    GlobalManager"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Instance"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Client"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("MessageReceived "),a("span",{attrs:{class:"token operator"}},[t._v("+")]),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" OnMessage"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-csharp extra-class"},[a("pre",{pre:!0,attrs:{class:"language-csharp"}},[a("code",[t._v("    "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("OnDestroy")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        GlobalManager"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Instance"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Client"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("MessageReceived "),a("span",{attrs:{class:"token operator"}},[t._v("-")]),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" OnMessage"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-csharp extra-class"},[a("pre",{pre:!0,attrs:{class:"language-csharp"}},[a("code",[t._v("    "),a("span",{attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("OnMessage")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("object")]),t._v(" sender"),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("MessageReceivedEventArgs")]),t._v(" e"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        "),a("span",{attrs:{class:"token keyword"}},[t._v("using")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token class-name"}},[t._v("Message")]),t._v(" m "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" e"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("GetMessage")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n        "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n            "),a("span",{attrs:{class:"token keyword"}},[t._v("switch")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Tags"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" m"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Tag"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n            "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n                "),a("span",{attrs:{class:"token keyword"}},[t._v("case")]),t._v(" Tags"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("LoginRequestDenied"),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n                    "),a("span",{attrs:{class:"token function"}},[t._v("OnLoginDecline")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n                    "),a("span",{attrs:{class:"token keyword"}},[t._v("break")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n                "),a("span",{attrs:{class:"token keyword"}},[t._v("case")]),t._v(" Tags"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("LoginRequestAccepted"),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n                    "),a("span",{attrs:{class:"token function"}},[t._v("OnLoginAccept")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("m"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token generic-method"}},[a("span",{attrs:{class:"token function"}},[t._v("Deserialize")]),a("span",{attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{attrs:{class:"token class-name"}},[t._v("LoginInfoData")]),a("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n                    "),a("span",{attrs:{class:"token keyword"}},[t._v("break")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n            "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n        "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("OnLoginDecline")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        LoginWindow"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("SetActive")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("true")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("OnLoginAccept")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token class-name"}},[t._v("LoginInfoData")]),t._v(" data"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-csharp extra-class"},[a("pre",{pre:!0,attrs:{class:"language-csharp"}},[a("code",[t._v("    "),a("span",{attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{attrs:{class:"token class-name"}},[t._v("Header")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token string"}},[t._v('"Public Fields"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("ushort")]),t._v(" PlayerId"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("LobbyInfoData")]),t._v(" LastRecievedLobbyInfoData"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-csharp extra-class"},[a("pre",{pre:!0,attrs:{class:"language-csharp"}},[a("code",[t._v("    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("OnLoginAccept")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token class-name"}},[t._v("LoginInfoData")]),t._v(" data"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        GlobalManager"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Instance"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("PlayerId "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" data"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Id"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n        GlobalManager"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Instance"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("LastRecievedLobbyInfoData "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" data"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Data"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n        SceneManager"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("LoadScene")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token string"}},[t._v('"Lobby"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v('Create a new Scene "Lobby" in the Scenes folder and open it.')]),this._v(" "),s("li",[this._v("Create a LobbyManager GameObject.")]),this._v(" "),s("li",[this._v('Create a "LobbyManager" script in the Scripts folder and add it to the LobbyManager GameObject.')])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v('Create a Canvas > set it to "Scale with Screen Size" and Reference Resolution to 1920x1080')]),this._v(" "),s("li",[this._v("Create a Scroll View as a child of the Canvas.")]),this._v(" "),s("li",[this._v("Add a Vertical Layout Group to the Content object of the Scroll view")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-csharp extra-class"},[a("pre",{pre:!0,attrs:{class:"language-csharp"}},[a("code",[a("span",{attrs:{class:"token keyword"}},[t._v("using")]),t._v(" UnityEngine"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{attrs:{class:"token keyword"}},[t._v("using")]),t._v(" UnityEngine"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("UI"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("RoomListObject")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("MonoBehaviour")]),t._v("\n"),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{attrs:{class:"token class-name"}},[t._v("Header")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token string"}},[t._v('"References"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("Text")]),t._v(" NameText"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("Text")]),t._v(" SlotText"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("Button")]),t._v(" JoinButton"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("Set")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token class-name"}},[t._v("RoomData")]),t._v(" data"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        NameText"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("text "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" data"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Name"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n        SlotText"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("text "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" data"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Slots "),a("span",{attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{attrs:{class:"token string"}},[t._v('"/"')]),t._v(" "),a("span",{attrs:{class:"token operator"}},[t._v("+")]),t._v(" data"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("MaxSlots"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Create a UI Image as a child of the Content of Scroll View and name it RoomListPrefab.")]),this._v(" "),s("li",[this._v("Add 2 texts and a button to it, 1 text will be the name the other the slots and the button will be used to join the room.")]),this._v(" "),s("li",[this._v("Add the RoomListObject script to it and refrecne the texts and the button.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-csharp extra-class"},[a("pre",{pre:!0,attrs:{class:"language-csharp"}},[a("code",[a("span",{attrs:{class:"token keyword"}},[t._v("using")]),t._v(" DarkRift"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{attrs:{class:"token keyword"}},[t._v("using")]),t._v(" DarkRift"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Client"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{attrs:{class:"token keyword"}},[t._v("using")]),t._v(" UnityEngine"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{attrs:{class:"token keyword"}},[t._v("using")]),t._v(" UnityEngine"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("SceneManagement"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("LobbyManager")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("MonoBehaviour")]),t._v("\n"),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("LobbyManager")]),t._v(" Instance"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{attrs:{class:"token class-name"}},[t._v("Header")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token string"}},[t._v('"References"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("Transform")]),t._v(" RoomListContainerTransform"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{attrs:{class:"token class-name"}},[t._v("Header")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token string"}},[t._v('"Prefabs"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("GameObject")]),t._v(" RoomListPrefab"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("Awake")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        Instance "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("this")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("Start")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        GlobalManager"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Instance"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Client"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("MessageReceived "),a("span",{attrs:{class:"token operator"}},[t._v("+")]),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" OnMessage"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n        "),a("span",{attrs:{class:"token function"}},[t._v("RefreshRooms")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("GlobalManager"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Instance"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("LastRecievedLobbyInfoData"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("OnDestroy")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        GlobalManager"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Instance"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Client"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("MessageReceived "),a("span",{attrs:{class:"token operator"}},[t._v("-")]),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" OnMessage"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("OnMessage")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("object")]),t._v(" sender"),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("MessageReceivedEventArgs")]),t._v(" e"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        "),a("span",{attrs:{class:"token keyword"}},[t._v("using")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token class-name"}},[t._v("Message")]),t._v(" m "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" e"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("GetMessage")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n        "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n            "),a("span",{attrs:{class:"token keyword"}},[t._v("switch")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Tags"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("m"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Tag"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n            "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n              \n            "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n        "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n   \n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("RefreshRooms")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token class-name"}},[t._v("LobbyInfoData")]),t._v(" data"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        RoomListObject"),a("span",{attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" roomObjects "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" RoomListContainerTransform"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token generic-method"}},[a("span",{attrs:{class:"token function"}},[t._v("GetComponentsInChildren")]),a("span",{attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{attrs:{class:"token class-name"}},[t._v("RoomListObject")]),a("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n        "),a("span",{attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{attrs:{class:"token number"}},[t._v("0")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),a("span",{attrs:{class:"token operator"}},[t._v("<")]),t._v(" data"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Rooms"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Length"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),a("span",{attrs:{class:"token operator"}},[t._v("++")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n        "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n            "),a("span",{attrs:{class:"token class-name"}},[t._v("RoomData")]),t._v(" d "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" data"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Rooms"),a("span",{attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),a("span",{attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n            "),a("span",{attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{attrs:{class:"token operator"}},[t._v("<")]),t._v(" roomObjects"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Length"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n            "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n                roomObjects"),a("span",{attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),a("span",{attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("Set")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("d"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n            "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n            "),a("span",{attrs:{class:"token keyword"}},[t._v("else")]),t._v("\n            "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n                "),a("span",{attrs:{class:"token class-name"}},[t._v("GameObject")]),t._v(" go "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("Instantiate")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RoomListPrefab"),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" RoomListContainerTransform"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n                go"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token generic-method"}},[a("span",{attrs:{class:"token function"}},[t._v("GetComponent")]),a("span",{attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{attrs:{class:"token class-name"}},[t._v("RoomListObject")]),a("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("Set")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("d"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n            "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n        "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-csharp extra-class"},[a("pre",{pre:!0,attrs:{class:"language-csharp"}},[a("code",[t._v("    LobbyJoinRoomRequest "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{attrs:{class:"token number"}},[t._v("100")]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n    LobbyJoinRoomDenied "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{attrs:{class:"token number"}},[t._v("101")]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n    LobbyJoinRoomAccepted "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{attrs:{class:"token number"}},[t._v("102")]),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-csharp extra-class"},[a("pre",{pre:!0,attrs:{class:"language-csharp"}},[a("code",[a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("struct")]),t._v(" JoinRoomRequest "),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" IDarkRiftSerializable\n"),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("string")]),t._v(" RoomName"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("JoinRoomRequest")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("string")]),t._v(" name"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        RoomName "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" name"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("Deserialize")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token class-name"}},[t._v("DeserializeEvent")]),t._v(" e"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        RoomName "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" e"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Reader"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("ReadString")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("Serialize")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token class-name"}},[t._v("SerializeEvent")]),t._v(" e"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        e"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Writer"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("Write")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RoomName"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-csharp extra-class"},[a("pre",{pre:!0,attrs:{class:"language-csharp"}},[a("code",[t._v("    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("SendJoinRoomRequest")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("string")]),t._v(" roomName"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        "),a("span",{attrs:{class:"token keyword"}},[t._v("using")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token class-name"}},[t._v("Message")]),t._v(" m "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" Message"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("Create")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("ushort")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("Tags"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("LobbyJoinRoomRequest"),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("JoinRoomRequest")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("roomName"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n        "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n            GlobalManager"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Instance"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Client"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("SendMessage")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("m"),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" SendMode"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Reliable"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n        "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("OnRoomJoinDenied")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token class-name"}},[t._v("LobbyInfoData")]),t._v(" data"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        "),a("span",{attrs:{class:"token function"}},[t._v("RefreshRooms")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n    "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("OnRoomJoinAcepted")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        SceneManager"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("LoadScene")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token string"}},[t._v('"Game"')]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-csharp extra-class"},[a("pre",{pre:!0,attrs:{class:"language-csharp"}},[a("code",[t._v("    "),a("span",{attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("OnMessage")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("object")]),t._v(" sender"),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("MessageReceivedEventArgs")]),t._v(" e"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n        "),a("span",{attrs:{class:"token keyword"}},[t._v("using")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token class-name"}},[t._v("Message")]),t._v(" m "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" e"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("GetMessage")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n        "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n            "),a("span",{attrs:{class:"token keyword"}},[t._v("switch")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Tags"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("m"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Tag"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n            "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n                "),a("span",{attrs:{class:"token keyword"}},[t._v("case")]),t._v(" Tags"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("LobbyJoinRoomDenied"),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n                    "),a("span",{attrs:{class:"token function"}},[t._v("OnRoomJoinDenied")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("m"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token generic-method"}},[a("span",{attrs:{class:"token function"}},[t._v("Deserialize")]),a("span",{attrs:{class:"token punctuation"}},[t._v("<")]),a("span",{attrs:{class:"token class-name"}},[t._v("LobbyInfoData")]),a("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n                    "),a("span",{attrs:{class:"token keyword"}},[t._v("break")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n                "),a("span",{attrs:{class:"token keyword"}},[t._v("case")]),t._v(" Tags"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("LobbyJoinRoomAccepted"),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n                    "),a("span",{attrs:{class:"token function"}},[t._v("OnRoomJoinAcepted")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n                    "),a("span",{attrs:{class:"token keyword"}},[t._v("break")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n            "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n        "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n    "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-csharp extra-class"},[a("pre",{pre:!0,attrs:{class:"language-csharp"}},[a("code",[t._v("JoinButton"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("onClick"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("RemoveAllListeners")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nJoinButton"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("onClick"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("AddListener")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("delegate")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" LobbyManager"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Instance"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("SendJoinRoomRequest")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Name"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])}],!1,null,null,null);e.options.__file="client-login-system-part-2-and-lobby.md";s.default=e.exports}}]);