Coder Social home page Coder Social logo

socketweaver / lobby Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 4.0 772 KB

A Multiplayer lobby example project in Unity using the SocketWeaver SDK

Home Page: https://www.socketweaver.com

C# 100.00%
unity game-development game-engine multiplayer game-server networking lobby matchmaking matchmaking-server rooms unet photon

lobby's Introduction

Basic Lobby

Alt text

Requirements

  1. Unity 2018.3.4 or later. You can download the latest version of Unity here: https://unity3d.com/get-unity/download
  2. A SocketWeaver Account. You can create a SocketWeaver Account for free here: https://portal.socketweaver.com

All accounts get 20GB of data for FREE every month.

What we are making

In this tutorial, we are going to make a basic lobby with the following features.

  1. Custom player name
  2. Custom room data
  3. Player chat
  4. Room chat
  5. Team management
  6. Room list with paging

We will show you the process step-by-step. By the time you finished reading this tutorial, you will be ready to start creating your own lobby interface and matchmaking logic.

Source Code

The source code of this tutorial is hosted at: https://github.com/SocketWeaver/lobby

The repository has two Unity Projects:

Lobby-start

We recommend you start with the Lobby-start starter project and follow the steps of the tutorial to get the most out of it.

Lobby-final

The final lobby project.

Community

If you have questions about the tutorial, join our discord server at: https://discord.gg/qXt7Bkf

Home

lobby's People

Contributors

shuningzhou avatar socketweaver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lobby's Issues

How to get Room by name?

I am able to get rooms with GetRooms, but it returns based on page index and total item per page.
Here i would like to get room by its name.

Meaning, instead of listing all rooms, i would let user to enter the exact name to be able to enter the room.

The FilterRoom seems to serve the purpose (from its naming convention), but i am getting the error
image

By the way, i didnt see any example with FilterRoom. correct me if i am wrong.

FilterRoom return 0 room in mobile app

I have a code that works in desktop and unity, which filters the room based on a number
But when i install the APK and test in android, the filter room returns 0 room...

Did I miss anything?

Sometimes, Register fails with message Object reference not set to an instance of an object

image

As titled, sometimes the Register function just fails with the message, which, is outside the callback.
Here's my code

 public void RegisterPlayer()
    {
        Debug.Log("Registering...");
        NetworkClient.Lobby.Register(CurrentPlayerName, (successful, reply, error) => {
            if (successful)
            {
                Debug.Log($"Lobby registered roomId: {reply.roomId}, started: {reply.started}");
            }
            else
            {
                Debug.Log("Lobby failed to register " + reply);
            }
        });
    }

I expect it at least appears after "Lobby failed to register".. but it seems to totally throw the exception.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.