Jump to content

The new directories, build 25+. client/server/shared


RAINBOW

Recommended Posts

I'm almost certain I am having an issue with directory structure since the new move to multiplayer.

 

I have this (Working) example of code here:

--+ Raenbow +----+ 2nd May 2014 +-- --+ CHECK FILE EXISTS +---- --prints an error message if file not exist in dir.  function checkFileExist(_sFile) local string sFile = _sFile;local file = getFileReader(sFile, false); -- dir: C:\Users\User\Zomboid\Luaif file == nil then  --does anything exist there?print("RAENBOW : Could not find file : ".. sFile .. " in C:\Users\User\Zomboid\Lua");elseprint("RAENBOW : Successfully found file :" .. sFile .. " in C:\Users\User\Zomboid\Lua");--File exists, do nothing.--line = file:readLine();   --Could go further, and identify file type (e.g. .png, .txt)end end  function raenbow_includeMain()checkFileExist("Item_Ctoken.png"); end Events.OnGameStart.Add(raenbow_includeMain);

The code came from my desire to add in a "CheckFileExists" functionality to my main include file.  

It's position in my folder structure is:

 

 


--User

    --Zomboid

        --Mods

            --MyMod

            +Poster.png

            +mod.info

                --media

                    --lua

                        --client

                        +MYMAININCLUDEFILEHERE.lua

                        --server

                        --shared

                    --scripts

                    --textures

 

 

So far everything looks good huh?  I create a wee server with my computer, to test it will be okay in multiplayer- that's when things get interesting!  On the same computer, I boot up my PZ client, that is to say, the one with the "Join Server" option.  Still with me? cool.

 

In the join server option, I pop in the loopback, 127.0.0.1, and voila! What once was working when I tried in "Survival" or "Sandbox" will not work! no print statement is returned!

 

What do you think is going on?

Link to comment
Share on other sites

Hahaah, its funny how sometimes taking a double look at your stuff will explain it all!

 

I had it in the client folder, despite it having to be acted upon in the server folder! So unbelievably simple, how these little networking nuances can catch you out:

 

--User

    --Zomboid

        --Mods

            --MyMod

            +Poster.png

            +mod.info

                --media

                    --lua

                        --client

                        --server

                        +MYMAININCLUDEFILEHERE.lua

                        --shared

                    --scripts

                    --textures

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...