Forum

> > CS2D > Scripts > Server does not show images
Forums overviewCS2D overview Scripts overviewLog in to reply

English Server does not show images

7 replies
To the start Previous 1 Next To the start

old Server does not show images

Mora
User Off Offline

Quote
Hello.
Well, title says it not so good since idk how i name this shit sry.

The lua has images that load from the folder and adding their names intothe table:

for item in io.enumdir(csc.gamepath) do


Everything is working fine when I start New Game. It outputs me all filenames and images set correctly by indexing their path.


But when I load all files on server and start dedicated server. Joined it and i can't see any image.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
csc.hookfunc.spawn = function(id)
	if player(id, 'bot') then return end

	local get_image = csc.ranks[csc.players[id].Rank].ImagePath


	if csc.players[id].RankImage then

		freeimage(csc.players[id].RankImage)
		csc.players[id].RankImage = nil

	end

	csc.players[id].RankImage = image(get_image, 0, 0, 200+id)
end
addhook('spawn', 'csc.hookfunc.spawn')

Also lua has save/load system and files created successfully on root device on Server, which means it has rights to read or h/e it named..
Maybe this way
for item in io.enumdir(csc.gamepath) do
is not that good, Idk i just used to it all time and it worked well for me. Maybe it requires more access?

There is no any lua error:
edited 2×, last 25.06.24 05:51:17 am

old Re: Server does not show images

Cure Pikachu
User Off Offline

Quote
Try printing the output of
get_image
to debug (This needs to include the path relative to CS2D folder). Going in blind when what I see printed out so far are just file names. Maybe the code snippet for that portion will help?

Also want to get the obvious out of the way: Client side has those images at the exact directory right?
edited 3×, last 25.06.24 07:29:46 am

old Re: Server does not show images

Mora
User Off Offline

Quote
Well, I will try to check what it must output me later when I back to home.

Yeah, client side has those images in the same directory. Server-transfer also includes all images and is checked on join.

/EDIT: msg(get_image) return this:
gfx/Mora/CSC/Games/ClassicRanked/Ranks/1Private.png

And if we get into cs2d folder and write this path:
IMG:https://i.postimg.cc/QMGhKwgN/s1.png

it opens:
IMG:https://i.postimg.cc/hv5qD5PB/sc2.png
edited 2×, last 25.06.24 04:22:06 pm

old Re: Server does not show images

Cure Pikachu
User Off Offline

Quote
@user Bowlinghead: Shouldn't matter on Windows (Explorer) anyway, considering it still opened the image as stated. Seems like any forward or backward slashes will be auto-resolved to the appropriate one when parsed on Windows.

This is quite interesting,
get_image
seems correct for the script and there were no errors outputted...

old Re: Server does not show images

Mora
User Off Offline

Quote
Yeah, it doesn't matter if u write it \ or / since image is found and in New Game server it show me image(i even made screen :D).
The problem that is not show the same thing on Dedicated paid server.

/edit: i will try to change get_image to direct path and see what would be happen..
-well, it also does not show me anything and has no errors:
IMG:https://i.postimg.cc/x1tkBGSv/image.png


/edit1: meanwhile all other effects in the same .lua which has images and direct pathes is visible..:
edited 1×, last 26.06.24 07:51:35 am

old Re: Server does not show images

Mora
User Off Offline

Quote
Yeah, i have deleted my cs2d CSC folder and joined server. It has created all directories and downloaded all needed files but still it doesn't show me them.

Also, since i have deleted all CSC files and downloaded from Server i tried to turn on New Game and all images are visible, it means path is not wrong.
chmod 777 ./cs2d_dedicated
sudo ./cs2d_dedicated
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview