natepac / playfabmirrorgameexample

Example game using Mirror within Unity running on top of PlayFab hosting
105 stars 33 forks source link

NetworkMessage, MsgType, and writer.write are not being recognized. #1

Open Crasiuss opened 4 years ago

Crasiuss commented 4 years ago

Hello. I am trying to get into the multiplayer world, and I was hoping to try this sample project to have an idea how I can use mirror with playfab. After importing PlayFab SDK and GSDK from their respective repository, I imported Mirror from the Asset Store, then I cloned this repository and dragged everything into the project, except for the Mirror and PlayfabSDK as I had them already. After these steps, some errors showed up in the console:

Assets\Scripts\UnityNetworkServer.cs(57,38): error CS0246: The type or namespace name 'NetworkMessage' could not be found (are you missing a using directive or an assembly reference?)

Inside the method AddRemoteServerListeners(), in the UnityNetworkServer.cs, MsgType are not being found, it says they don't exist in the current context.

Finally, writer.Write(str) in the same script, line 154, Write() is not being recognized as a method from writer. In my search for a solution to these problems through the internet, I found here that Write() has being deprecated, so I changed it to writer.WriteString(str) instead and the error from this one disappeared. However, I am a noob and I am not sure if this is the right fix here.

Thank you in advance!

natepac commented 4 years ago

You don’t need to import anything into my example project. All code and everything is ready to go, just use the project as is. Follow the document and you should be good.

Thanks!

—Nate

On May 9, 2020, at 1:59 PM, Crasiuss notifications@github.com wrote:

 Hello. I am trying to get into the multiplayer world, and I was hoping to try this sample project to have an idea how I can use mirror with playfab. After importing PlayFab SDK and GSDK from their respective repository, I imported Mirror from the Asset Store, then I cloned this repository and dragged everything into the project, except for the Mirror and PlayfabSDK as I had them already. After these steps, some errors showed up in the console:

Assets\Scripts\UnityNetworkServer.cs(57,38): error CS0246: The type or namespace name 'NetworkMessage' could not be found (are you missing a using directive or an assembly reference?)

Inside the method AddRemoteServerListeners(), in the UnityNetworkServer.cs, MsgType are not being found, it says they don't exist in the current context.

Finally, writer.Write(str) in the same script, line 154, Write() is not being recognized as a method from writer. In my search for a solution to these problems through the internet, I found here that Write() has being deprecated, so I changed it to writer.WriteString(str) instead and the error from this one disappeared. However, I am a noob and I am not sure if this is the right fix here.

Thank you in advance!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.