handle login better, get rid of ghost self
This commit is contained in:
parent
f323d09d9f
commit
b44d3e03ca
Binary file not shown.
|
@ -31,8 +31,8 @@ program main
|
|||
me = player(username, vector3(0.0_c_float, 1.0_c_float, 2.0_c_float), PURPLE)
|
||||
players = me%login(password)
|
||||
|
||||
camera%position = vector3(0.0_c_float, 10.0_c_float, 10.0_c_float) !Camera position
|
||||
camera%target = vector3(0.0_c_float, 0.0_c_float, 0.0_c_float) !Camera looking at point
|
||||
camera%position = vector3(me%position%x,me%position%y + 10.0_c_float , me%position%z + 10.0_c_float ) !Camera position
|
||||
camera%target = vector3(me%position%x,me%position%y,me%position%z) !Camera looking at point
|
||||
camera%up = vector3(0.0_c_float, 1.0_c_float, 0.0_c_float) !Camera up vector(rotation towards target)
|
||||
camera%fovy = 45.0_c_float !Camera field - of - view Y
|
||||
camera%projection = CAMERA_PERSPECTIVE !Camera projection type
|
||||
|
|
|
@ -157,6 +157,7 @@ contains
|
|||
call json%get(recv_users, "/users/"//istr//"/username", username, found)
|
||||
if (.not. found) stop 1
|
||||
|
||||
if (username .ne. this%username) then
|
||||
if (allocated(players)) then
|
||||
players = [players, player(username, vector3(x_pos, 1.0_c_float, y_pos), &
|
||||
color(apperance_r, apperance_g, apperance_b, 255))]
|
||||
|
@ -164,6 +165,20 @@ contains
|
|||
players = [player(username, vector3(x_pos, 1.0_c_float, y_pos), &
|
||||
color(apperance_r, apperance_g, apperance_b, 255))]
|
||||
end if
|
||||
else
|
||||
if (request_type .eq. 1) then
|
||||
print *, 'login, setting pos'
|
||||
this%position%x = x_pos
|
||||
this%position%y = y_pos
|
||||
print *, x_pos, y_pos
|
||||
|
||||
print *, 'login, setting apperance'
|
||||
this%apperance%r = apperance_r
|
||||
this%apperance%g = apperance_g
|
||||
this%apperance%b = apperance_b
|
||||
print *, apperance_r, apperance_g, apperance_b
|
||||
end if
|
||||
end if
|
||||
end do
|
||||
end if
|
||||
|
||||
|
|
|
@ -81,7 +81,6 @@ program main
|
|||
rc = db_move_user(db, username, x_pos, y_pos)
|
||||
else ! (2) if logout update logged_in to database
|
||||
rc = db_logout_user(db, username)
|
||||
exit server_loop
|
||||
end if
|
||||
|
||||
rc = db_get_logged_in_users(db, connection)
|
||||
|
|
|
@ -231,7 +231,7 @@ contains
|
|||
|
||||
integer function db_logout_user(db, username) result(rc)
|
||||
type(db_type), intent(inout) :: db
|
||||
character(len=24), intent(in) :: username
|
||||
character(len=:), allocatable, intent(in) :: username
|
||||
type(c_ptr) :: stmt
|
||||
|
||||
rc = sqlite3_prepare_v2(db%ptr, &
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
program main
|
||||
use iso_fortran_env
|
||||
implicit none
|
||||
|
||||
write(output_unit, "(i3, 1x, a24, 1x, f8.2, 1x, f8.2)") 0, 'chakr', 0.0, 0.0
|
||||
|
||||
end program main
|
Loading…
Reference in New Issue