Announcement

Collapse
No announcement yet.

MMO Starter Kit

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by Elrodus View Post
    Hi, is there any way to pack AndroidClient using that files?
    Some people have reported to have successfully packed it on android, yes.
    MMO Starter Kit
    Dialogue Plugin
    Voxel Plugin
    Character Customization: Female
    Character Custmization: Male

    Comment


      Use Steam,how to set Dedicated Server
      Last edited by yskwork; 02-27-2019, 08:14 AM.

      Comment


        Originally posted by yskwork View Post
        Use Steam,how to set Dedicated Server
        I don't understand the question exactly. Do you want to use steam API to launch dedicated servers or do you want to know how to launch the dedicated server once your project is relying on steam? If it's the former, I've got no experience with this. If it's the latter, the idea is to not use Steam on dedicated server at all. Personally I had a -nosteam parameter that I integrated into the engine sources and I launched dedicated servers with it.
        MMO Starter Kit
        Dialogue Plugin
        Voxel Plugin
        Character Customization: Female
        Character Custmization: Male

        Comment


          OK,no use OnlineSubsystemSteam,how to get SteamID and account name

          CSteamID from Player State

          #include "steam/steam_api.h"
          #include "steam/isteamuser.h"
          #include "steam/isteamutils.h"

          if(PlayerState)
          {
          CSteamID TheSteamifiedPlayerID(*(uint64*)PlayerState->UniqueId->GetBytes());
          }


          How to add to the project
          Last edited by yskwork; 02-28-2019, 07:15 AM.

          Comment


            Originally posted by yskwork View Post
            OK,no use OnlineSubsystemSteam,how to get SteamID and account name

            CSteamID from Player State

            #include "steam/steam_api.h"
            #include "steam/isteamuser.h"
            #include "steam/isteamutils.h"

            if(PlayerState)
            {
            CSteamID TheSteamifiedPlayerID(*(uint64*)PlayerState->UniqueId->GetBytes());
            }


            How to add to the project
            On Client, you do use Steam. You get your steamid like this:


            When the player logs in, he sends his SteamSessionTicket to php scripts, which verify that he owns the game. To get the ticket, do this:
            Code:
            FString UMMOUtility::GetSteamSessionTicket(int32 LocalUserNum)
            {
                IOnlineIdentityPtr Identity = Online::GetIdentityInterface();
            
                if (!Identity.IsValid())
                {
                    return TEXT("Identity interface not found");
                }
            
                return Identity->GetAuthToken(LocalUserNum);
            }
            On the PHP side of things, this is how you check if the player with this session ticket owns your game:
            Code:
            $mydata = json_decode(file_get_contents('php://input'));
            
            $auth_token = $mydata ->auth_token;
            
            $curl = curl_init();
            
            // ask steam_api if this user has this game
            curl_setopt_array($curl, array(
                CURLOPT_RETURNTRANSFER => 1,
                CURLOPT_URL => 'https://partner.steam-api.com/ISteamUserAuth/AuthenticateUserTicket/v0001/?format=json&key=YOUR_PARTNER_KEY&appid=YOUR_APP_ID&ticket='.$auth_token,
                CURLOPT_USERAGENT => 'Codular Sample cURL Request',
                CURLOPT_CONNECTTIMEOUT => 0,  //timeout in seconds (0 - indefinitely)
                CURLOPT_TIMEOUT => 400  //timeout in seconds
            ));
            // Send the request & save response to $resp
            $response = curl_exec($curl);
            
            $response = str_replace ("\n", "", $response);
            $response = str_replace ("\t", "", $response);
            $json = json_decode($response, true);
            
            // Close request to clear up some resources
            curl_close($curl);
            
            if ($json['response']['params']['result']=="OK")
            {    
                $steamid = $json['response']['params']['steamid'];
            
                // now you have his steamid from SteamAPI, so you know it's the real one
                // if the player's steam account does own the game, the php script creates a sort of a cookie in DB and sends it back to player as well
            In the example above you need to replace YOUR_APP_ID with something like 712571 and YOUR_PARTNER_KEY with something like 91DFF2F2FF1D526D45DD3BC193F193D2. It's a key that you have to generate on the partner.steamgames.com, I don't remember where exactly. You can contact steam support if you can't find where to generated it, because I remember it was well hidden when I had to find it last time. And it resembles some other key, but it's not it. To check if your key is correct, just paste the link with parameters in your browser and see what the result is.

            When the server has to authenticate the player, it checks whether the cookie the player is sending corresponds to the one in db.

            Regarding your code, this is how you get SteamID, although you don't need it on Client, because sending it to server would be unreliable:
            Code:
            PlayerController->PlayerState->UniqueId->ToString(); // gets you steamid that starts with 765....
            Last edited by CodeSpartan; 03-01-2019, 04:46 PM.
            MMO Starter Kit
            Dialogue Plugin
            Voxel Plugin
            Character Customization: Female
            Character Custmization: Male

            Comment


              UE4 Report errors,why
              Attached Files
              Last edited by yskwork; 03-02-2019, 04:25 AM.

              Comment


                Some includes are obviously missing.

                Code:
                #include "Online.h"
                #include "OnlineIdentityInterface.h"
                Last edited by CodeSpartan; 03-01-2019, 09:48 PM.
                MMO Starter Kit
                Dialogue Plugin
                Voxel Plugin
                Character Customization: Female
                Character Custmization: Male

                Comment


                  1,ok, how to get Steam account name
                  2,PHP Report errors,why
                  Attached Files
                  Last edited by yskwork; 03-02-2019, 05:01 AM.

                  Comment


                    It's a scope problem. You declare the variable in one scope, but want to access it in another, where it's not accessible. I recommend you to go through at least one basic php tutorial before continuing.
                    MMO Starter Kit
                    Dialogue Plugin
                    Voxel Plugin
                    Character Customization: Female
                    Character Custmization: Male

                    Comment


                      Thank you very much!

                      Comment


                        Hey CodeSpartan I Have A Problem Regarding TheLauncher/Auto Updater I get the gameupdater.exe working but whenever i launch the launcher i get this errors"one or more error has occured" i looked at doc and it said i do not have hash.xml but i do have it and it said try to adjust the permission.i dont know what should i adjust..do u have skype?

                        Comment


                          Can not get auth_token,why

                          without using Online Subsystem Steam (plugin)
                          Attached Files
                          Last edited by yskwork; 03-03-2019, 09:10 PM.

                          Comment


                            Originally posted by CodeSpartan View Post
                            It's a scope problem. You declare the variable in one scope, but want to access it in another, where it's not accessible. I recommend you to go through at least one basic php tutorial before continuing.
                            Hey CodeSpartan I Have A Problem Regarding The Launcher/AutoUpdater When I Launch The Launcher I Got This Error "One Or More Error Has Occured" I Have The hash.xml but it still said i have error

                            Comment


                              Originally posted by yskwork View Post
                              Can not get auth_token,why

                              without using Online Subsystem Steam (plugin)
                              I don't understand why you're trying to get a steam ticket without steam. That's impossible. You need to have steam enabled on Client.


                              Originally posted by KhxiSaki View Post

                              Hey CodeSpartan I Have A Problem Regarding The Launcher/AutoUpdater When I Launch The Launcher I Got This Error "One Or More Error Has Occured" I Have The hash.xml but it still said i have error

                              Can't even venture a guess. You need to launch it through visual studio in debug mode to find out the reason. The sources are provided.
                              MMO Starter Kit
                              Dialogue Plugin
                              Voxel Plugin
                              Character Customization: Female
                              Character Custmization: Male

                              Comment


                                If using Online Subsystem Steam (plugin) ,Client Unable to connect dedicated server ,why

                                My project/Config DefaultEngine

                                [/Script/HardwareTargeting.HardwareTargetingSettings]
                                TargetedHardwareClass=Desktop
                                AppliedTargetedHardwareClass=Desktop
                                DefaultGraphicsPerformance=Maximum
                                AppliedDefaultGraphicsPerformance=Maximum

                                [/Script/Engine.GameEngine]
                                !NetDriverDefinitions=ClearArray
                                +NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

                                [OnlineSubsystem]
                                DefaultPlatformService=Steam
                                PollingIntervalInMs=20
                                bHasVoiceEnabled=true

                                [OnlineSubsystemSteam]
                                bEnabled=true
                                SteamDevAppId=480
                                GameServerQueryPort=27015
                                bRelaunchInSteam=false
                                GameVersion=1.0.0.0
                                bVACEnabled=1
                                bAllowP2PPacketRelay=true
                                P2PConnectionTimeout=90

                                [Voice]
                                bEnabled=true
                                [Core.Log]
                                LogNet=verbose
                                LogOnline=verbose
                                LogVoice=verbose
                                [/Script/OnlineSubsystemSteam.SteamNetDriver]
                                NetConnectionClassName="/Script/OnlineSubsystemSteam.SteamNetConnection"
                                Last edited by yskwork; 03-03-2019, 11:01 PM.

                                Comment

                                Working...
                                X